/*
* $Id: AddQueenBeeWizard.java 272 2011-02-21 05:37:35Z volok-aleksej@yandex.ru $
*
* Copyright 2008-2011 by Volokitin Alexey
* All rights reserved
*
*/
package apiary.component.journal;

import apiary.Apiary;
import apiary.db.managers.DBManager;
import apiary.ui.BackScreen;
import apiary.ui.journal.QueenBeeForm;
import apiary.ui.journal.QueenBeeForm.QueenBeeValue;

/**
 * Wizard of adding queen bee
 * @author lexus
 */
public class AddQueenBeeWizard extends Wizard
{
    /**
     * Constructor
     */
    public AddQueenBeeWizard() {
        super(null);
        Init();
    }
    /**
     * Constructor
     * @param parentForm Form where it want to move when pressing Back.
     * This form used only on first form of wizard
     */
    public AddQueenBeeWizard(BackScreen parentForm) {
        super(null);
        Init();
        setCancelForm(parentForm);
    }

    /**
     * Saves result of wizard
     */
    public void save() {
        QueenBeeValue queenBee = (QueenBeeValue) getData(new Integer(1));
        DBManager.getInstance().addQueenBee(queenBee);
    }
    /**
     * Checks data of form on truth
     * @param dataForm data of form
     * @param idForm identificator of form
     * @return truth of data
     */
    public boolean isOk(Integer idForm, Object dataForm) {
        return true;
    }
    /**
     * @deprecated In this wizard don't use
     */
    public void next(BackScreen nextForm) {
    }

    /**
     * Initialize Wizard
     */
    private void Init() {
        Apiary apiary = Apiary.getInstance();
        Integer idForm = new Integer(1);
        firstForm = new QueenBeeForm(apiary.getLocaleString("AddQueenBee"), idForm, this, false);
    }
}
